﻿Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Xml.Linq
Imports Controladores
Imports BBDD

 _

Class altaUsuarioOperador
   Inherits System.Web.UI.Page

   Protected Sub boton_darseAlta_Click(sender As Object, e As EventArgs)
      
        If Me.campoSaldo.Text = "" Then
            Me.campoSaldo.Text = "-1"
        End If

        If Me.campoTlf.Text = "" Then
            Me.campoTlf.Text = "1"
        End If

        If Me.campoCP.Text = "" Then
            Me.campoCP.Text = "1"
        End If

        Session("error") = controlador.altaUsuario(campoNewDNI.Text.ToString(), camponombre.Text.ToString(), campoapellidos.Text.ToString(), campoemail.Text.ToString(), campodireccion.Text.ToString(), Long.Parse(campoTlf.Text.ToString()), campolocalidad.Text.ToString(), campoprovincia.Text.ToString(), campoPais.Text.ToString(), Integer.Parse(campoCP.Text.ToString()), Double.Parse(camposaldo.Text.ToString()), campoCC.Text.ToString(), campoPass.Text.ToString(), 1, 1)
        If Session("error").ToString() = "" Then

            Response.Redirect("index.aspx")
        Else
            MsgBox(Session("error"))

        End If
      
      controlador.CreateMessageAlert(Me, Session("error").ToString(), "Mensaje de error")
   End Sub 'boton_darseAlta_Click
End Class 'altaUsuarioOperador